import java.io.FileOutputStream;
import java.util.Arrays;

class Solution {
    public double findMedianSortedArrays(int[] nums1, int[] nums2) {
      int[] arr= new int[nums1.length+nums2.length];
        for (int i = 0; i < nums1.length; i++) {
            arr[i]=nums1[i];
        }
        int j=0;
        for (int i = nums1.length ; i <nums1.length+nums2.length ; i++) {
            arr[i]=nums2[j++];
        }
      Arrays.sort(arr);
        if ((nums1.length+nums2.length)%2==0){
     return  (arr[(arr.length-1)/2]+arr[((arr.length-1)/2)+1])/2.0;
        }else {
          return arr[((arr.length-1)/2)+1]/1.0;
        }
    }
}